import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询比赛列表
export function listRace(query) {
  return request({
    url: "/race-api/race/getRaceList",
    method: "get",
    params: query,
  });
}

// 查询比赛详细
export function getInfo(raceId) {
    return request({
      url: '/race-api/race/getInfo/' + parseStrEmpty(raceId),
      method: 'get'
    })
  }

// 新增比赛
export function addRace(data) {
  return request({
    url: "/race-api/race/addRace",
    method: "post",
    data: data,
  });
}

// 编辑比赛
export function editRace(data) {
  return request({
    url: "/race-api/race/editRace",
    method: "post",
    data: data,
  });
}

// 根据id删除赛事
export function delRace(raceId) {
  return request({
    url: "/race-api/race/del/" + parseStrEmpty(raceId),
    method: "get",
  });
}
